/**
 * Copyright &copy; 2012-2015 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.soccer.cms.modules.cms.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;

import com.soccer.cms.common.persistence.Page;
import com.soccer.cms.common.service.CrudService;
import com.soccer.cms.modules.cms.entity.Imageinfo;
import com.soccer.cms.modules.cms.dao.ImageinfoDao;

/**
 * 图片信息Service
 * @author zouqh
 * @version 2015-05-29
 */
@Service
@Transactional(readOnly = true)
public class ImageinfoService extends CrudService<ImageinfoDao, Imageinfo> {

	public Imageinfo get(String id) {
		return super.get(id);
	}
	
	public List<Imageinfo> findList(Imageinfo imageinfo) {
		return super.findList(imageinfo);
	}
	
	public Page<Imageinfo> findPage(Page<Imageinfo> page, Imageinfo imageinfo) {
		return super.findPage(page, imageinfo);
	}
	
	@Transactional(readOnly = false)
	public void save(Imageinfo imageinfo) {
		super.save(imageinfo);
	}
	
	@Transactional(readOnly = false)
	public Integer save(List<Imageinfo> imageinfoList){
		int count = 0;
		for (Imageinfo imageinfo : imageinfoList) {
			super.save(imageinfo);
			count++;
		}
		return count;
	}
	
	@Transactional(readOnly = false)
	public void delete(Imageinfo imageinfo) {
		super.delete(imageinfo);
	}
	
	@Transactional(readOnly = false)
	public Integer delete(List<Imageinfo> imageinfoList){
		int count = 0;
		for (Imageinfo imageinfo : imageinfoList) {
			super.delete(imageinfo);
			count++;
		}
		return count;
	}
	
	@Transactional(readOnly = false)
	public void delete(String ids) {
		if(!StringUtils.isEmpty(ids)){
			String [] idArray = ids.split(",");
			for (String id : idArray) {
				Imageinfo imageinfo = super.get(id);
				super.delete(imageinfo);
			}
		}
	} 
	
	
}